package demo4;

import java.util.ArrayList;
import java.util.List;

/*笔试题：cvte
   str1:welcome to cvte
   str2:come
   描述：删除第一个字符当中出现的所有第二个字符串的字符
   输出结果：wl t vt
 */

public class Test {
    public static List<Character> func(String str1,String str2){
        List<Character> list=new ArrayList<>();
        for (int i = 0; i < str1.length(); i++) {
            char ch=str1.charAt(i);
            if(!str2.contains(ch+"")){
                list.add(ch);
            }
        }
        return list;
    }

    public static void main(String[] args) {
        String str1="welcome to cvte";
        String str2="come";
        List<Character> ret=func(str1,str2);
        for(char ch:ret){
            System.out.print(ch);
        }

       /*
        List<String> list=new ArrayList<>();
        list.add("welcome to cvte");
        list.remove(new String("come"));
        System.out.println(list);
       */
    }
}
